<?php
// @formatter:off
/**
 * @file mainmenu.php
 *
 * @author Alejandro Dario Simi
 * @date $Date: 2013-05-24 23:14:00 +0000 (Fri, 24 May 2013) $
 *
 * $Id: mainmenu.php 66 2013-05-24 23:14:00Z daemonraco@gmail.com $
 * $URL: http://wcomix.googlecode.com/svn/tags/wcomix-1.0.0.2/themes/default/controlers/others/mainmenu.php $
 */
// @formatter:on

global $wcProfile;
global $wcReadRate;
global $wcGroupsHolder;
global $wcGroup;
global $wcDefaults;
global $wcThemeAssigns;
global $wcSession;

$wcThemeAssigns["MainMenuItems"] = array();

if($wcGroup) {
	$groupId = $wcGroup->id;

	$aux = array(
		"name" => "Home",
		"title" => "Home",
		"icon" => "home-icon.png",
		"url" => "?group={$groupId}"
	);
	$wcThemeAssigns["MainMenuItems"][] = $aux;
	if($wcProfile->allowedTo(WC_PERM_COLLECTION_LIST)) {
		$aux = array(
			"name" => "Collections",
			"title" => "Collections",
			"icon" => "collections-icon.png",
			"url" => "?action=".WC_ACTION_COLLECTION_LIST."&group={$groupId}"
		);
		$wcThemeAssigns["MainMenuItems"][] = $aux;
	}
	if($wcProfile->allowedTo(WC_PERM_TAG_LIST)) {
		$aux = array(
			"name" => "Tags",
			"title" => "Tags",
			"icon" => "tags-icon.png",
			"url" => "?action=".WC_ACTION_TAG_LIST."&group={$groupId}"
		);
		$wcThemeAssigns["MainMenuItems"][] = $aux;
	}
	if($wcProfile->allowedTo(WC_PERM_DIRECTORY_LIST)) {
		$aux = array(
			"name" => "Directories",
			"title" => "Directories",
			"icon" => "directories-icon.png",
			"url" => "?action=".WC_ACTION_DIRECTORY_LIST."&group={$groupId}"
		);
		$wcThemeAssigns["MainMenuItems"][] = $aux;
	}
	if($wcProfile->allowedTo(WC_PERM_SPECIAL_SEARCH)) {
		$aux = array(
			"name" => "Search",
			"title" => "Search",
			"icon" => "search-icon.png",
			"url" => "?action=".WC_ACTION_SEARCH."&group={$groupId}"
		);
		$wcThemeAssigns["MainMenuItems"][] = $aux;
	}
	if($wcProfile->allowedTo(WC_PERM_RULE_LIST)) {
		$aux = array(
			"name" => "Rules",
			"title" => "Rules",
			"icon" => "rules-icon.png",
			"url" => "?action=".WC_ACTION_RULE_LIST."&group={$groupId}"
		);
		$wcThemeAssigns["MainMenuItems"][] = $aux;
	}
	if($wcProfile->allowedTo(WC_PERM_SPECIAL_STATS)) {
		$aux = array(
			"name" => "Stats",
			"title" => "Stats",
			"icon" => "stats-icon.png",
			"url" => "?action=".WC_ACTION_STATS."&group={$groupId}"
		);
		$wcThemeAssigns["MainMenuItems"][] = $aux;
	}
	if($wcProfile->allowedTo(WC_PERM_USER_LIST)) {
		$aux = array(
			"name" => "Users",
			"title" => "Users",
			"icon" => "user-icon.png",
			"url" => "?action=".WC_ACTION_USER_LIST."&group={$groupId}"
		);
		$wcThemeAssigns["MainMenuItems"][] = $aux;
	}
	if(!$wcDefaults["no-credits"] && $wcProfile->allowedTo(WC_PERM_SPECIAL_CREDIT)) {
		$aux = array(
			"name" => "Credits",
			"title" => "Credits",
			"icon" => "wcomix.png",
			"url" => "?action=".WC_ACTION_CREDITS."&group={$groupId}"
		);
		$wcThemeAssigns["MainMenuItems"][] = $aux;
	}
}
?>